import React from 'react'
import style from './style.module.scss'
import { useNavigate } from 'react-router-dom'

export default function MyHeader(props) {
    const navigate = useNavigate()
    // 返回上一层的路径
    function goBack() {
      navigate('/')
    }
  return (
    <div className={style.header}>
      <span onClick={goBack} className='iconfont icon-fanhui'></span>
      {/* <div className={style.title}>{props.title}</div> */}
      <div className={style.title}>{props.children}</div>
    </div>
  )
}

MyHeader.propTypes = {
    title: ''
}
